package jermedit.gobjekte;

import java.awt.Rectangle;

/**
 * EditPoint's objects are positions that can be moved and define the location
 * of the objects that they belong to. They are Rectangle extention so 
 * the x,y coordinates are at the top left corner and hold square form 6x6
 * where midX and midY is the position at witch the Object that they belong to 
 * should have it's location of interest. Example - End of arrow.
 * @author Jordan
 */
public class EditPoint extends Rectangle {
    public final static int size = 6;
    // Rectangle x,y are Top Left Corner
    int midX, midY;
    
    public EditPoint(int x, int y ){
        super(x-size/2,y-size/2, size, size);
        midX = x;
        midY = y;
    }
    
    @Override
    public void move(int x, int y) {
        this.x = x-size/2;
        this.y = y-size/2;
        midX = x;
        midY = y;
    }
    
    public int getMidX(){
        return midX;
    }
    
    public int getMidY(){
        return midY;
    }
}
